import 'package:json_annotation/json_annotation.dart';

import 'cartoon_model.dart';
import 'pipe_scene_in_params.dart';
import 'pipe_wrapper_model.dart';
import 'user_model.dart';
import 'user_role.dart';

part 'pipe_model.g.dart';

@JsonSerializable()
class PipeModel extends Object {

  @JsonKey(name: 'id')
  String? id;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'cover')
  String cover;

  @JsonKey(name: 'summary')
  String? summary;

  @JsonKey(name: 'likeNum')
  int? likeNum;

  @JsonKey(name: 'useNum')
  int? useNum;

  @JsonKey(name: 'sortNum')
  int? sortNum;

  @JsonKey(name: 'publish')
  int? publish;

  @JsonKey(name: 'publishTime')
  String? publishTime;

  @JsonKey(name: 'cartoonId')
  String? cartoonId;

  @JsonKey(name: 'cartoonName')
  String? cartoonName;

  @JsonKey(name: 'cartoonAvatar')
  String? cartoonAvatar;

  @JsonKey(name: 'tags')
  List<String>? tags;

  @JsonKey(name: 'user')
  UserModel? user;

  @JsonKey(name: "attrList")
  List<UserRole>? attrList;

  @JsonKey(name: "inParams")
  List<PipeSceneInParams>? inParams;

  @JsonKey(name: "hasLike")
  int? hasLike;

  @JsonKey(name: "cartoon")
  CartoonModel? cartoon;

  @JsonKey(name: "wrapper")
  PipeWrapperModel? wrapper;

  PipeModel(this.id,this.name,this.cover,this.summary,this.likeNum,this.useNum,this.sortNum,this.publish,this.publishTime,this.cartoonId,this.cartoonName,this.cartoonAvatar,this.tags,this.user,this.attrList,this.hasLike,this.cartoon,this.inParams,this.wrapper);

  factory PipeModel.fromJson(Map<String, dynamic> srcJson) => _$PipeModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$PipeModelToJson(this);

}




